<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ page import="com.thinkgem.jeesite.common.utils.PropertiesLoader" %>

<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body class="row">
    <div class="col-md-11">
    	<div class="box box-info">
    		<div class="box-header with-border">
              <h3 class="box-title"></h3>
            </div>
            
            <c:if test="${waybill.classType == 0}">
            	<form:form id="inputForm" modelAttribute="tbWaybill" method="post" class="form-horizontal" novalidate="novalidate" action="${ctx }/tb_waybill/tbWaybill/runningPass">
            		<form:hidden path="fuelConsumption.id"/>
            		<form:hidden path="fuelConsumption.waybillId"/>
            		<div class="form-group" >
            			<label class="col-sm-2 control-label">品名</label>
            			<div class="col-sm-6">
	            			<form:select id="goodsId" path="fuelConsumption.goods.id" class="form-control select2 ">
								<form:option value="" label=""/>
								<form:options items="${goods}" itemValue="id" itemLabel="goodName" htmlEscape="false"/>
							</form:select>
							<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group" >
            			<label class="col-sm-2 control-label">数量</label>
            			<div class="col-sm-6">
            				<form:input path="fuelConsumption.weight" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group" >
            			<label class="col-sm-2 control-label">单价（元/升）</label>
            			<div class="col-sm-6">
            				<form:input path="fuelConsumption.unitPrice" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group" >
            			<label class="col-sm-2 control-label">金额</label>
            			<div class="col-sm-6">
	            			<form:input path="fuelConsumption.money" class="form-control number" />
	            			<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group" >
            			<label class="col-sm-2 control-label">时间</label>
            			<div class="col-sm-6">
            				<div class="input-group date">
	            				<div class="input-group-addon">
	            					<i class="fa fa-calendar"></i>
	            				</div>
			            		<input name="fuelConsumption.dateTime" type="text" readonly="readonly" maxlength="20" class="form-control pull-right"
								value="<fmt:formatDate value="${tbWaybill.beginCreateDate}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
            				</div>
            			</div>
            			
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">图片记录</label>
           				<c:if test="${fuelConsumption.bigPhotoArray != null }">
           					<div class="timeline-body">
            					<c:forEach items="${fuelConsumption.bigPhotoArray }" var="img" varStatus="status">
            						<img id="img_${status.count }" alt="图片记录" src="<%=PropertiesLoader.OSSPhotoUrlRequest() %>${img}" class="margin">
            					</c:forEach>
           					</div>
           				</c:if>
            		</div>
            		<div class="box-footer">
	                	<button type="submit" class="btn btn-default"  onclick="history.go(-1)">取消</button>
	                	<button type="submit" class="btn btn-info pull-right">提交</button>
	              	</div>
            	</form:form>
            </c:if>
            <c:if test="${waybill.classType == 1}">
            	<form:form id="inputForm" modelAttribute="tbWaybill" method="post" class="form-horizontal" novalidate="novalidate" action="${ctx }/tb_waybill/tbWaybill/runningPass">
            		<form:hidden path="cost.id"/>
            		<form:hidden path="cost.waybillId"/>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">项目</label>
            			<div class="col-sm-6">
            				<form:input path="cost.parst" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">单价</label>
            			<div class="col-sm-6">
            				<form:input path="cost.price" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">数量</label>
            			<div class="col-sm-6">
            				<form:input path="cost.number" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">金额</label>
            			<div class="col-sm-6">
            				<form:input path="cost.money" class="form-control number" />
            				<span class="help-block"></span>
            			</div>
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">时间</label>
            			<%-- <div class="col-sm-6">
            				<input name="cost.dateTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
							value="<fmt:formatDate value="${tbWaybill.beginCreateDate}" pattern="yyyy-MM-dd"/>"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
            			</div> --%>
            			<div class="col-sm-6">
            				<div class="input-group date">
	            				<div class="input-group-addon">
	            					<i class="fa fa-calendar"></i>
	            				</div>
			            		<input name="cost.dateTime" type="text" readonly="readonly" maxlength="20" class="form-control pull-right"
								value="<fmt:formatDate value="${tbWaybill.beginCreateDate}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
            				</div>
            			</div>
            		</div>
            		<div class="form-group">
            			<label class="col-sm-2 control-label">图片记录</label>
            			<c:if test="${fuelConsumption.bigPhotoArray != null }">
           					<div class="timeline-body">
            					<c:forEach items="${cost.bigPhotoArray }" var="img" varStatus="status">
            						<img id="img_${status.count }" alt="图片记录" src="<%=PropertiesLoader.OSSPhotoUrlRequest() %>${img}" class="margin">
            					</c:forEach>
           					</div>
           				</c:if>
            		</div>
            		<div class="box-footer">
	                	<button type="submit" class="btn btn-default" onclick="history.go(-1)">取消</button>
	                	<button type="submit" class="btn btn-info pull-right">提交</button>
	              	</div>
            	</form:form>
            </c:if>
    	</div>
    </div>
  </body>
<!-- jQuery 2.2.3 -->
<script src="${adminLET }/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.6 -->
<script src="${adminLET }/bootstrap/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js "></script>
<!-- Sparkline -->
<script src="${adminLET }/plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="${adminLET }/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${adminLET }/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="${adminLET }/plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
<script src="${adminLET }/plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="${adminLET }/plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="${adminLET }/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="${adminLET }/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="${adminLET }/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="${adminLET }/dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="${adminLET }/dist/js/demo.js"></script>
<script src="${ctxStatic }/My97DatePicker/WdatePicker.js"></script>
  <script type="text/javascript">
  	$("#inputForm").validate({
		submitHandler: function(form){
			loading('正在提交，请稍等...');
			form.submit();
		},
		errorContainer: "#messageBox",
		errorPlacement: function(error, element) {
			$("#messageBox").text("输入有误，请先更正。");
			if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".form-control")){
				error.appendTo(element.parent().parent());
			} else {
				error.insertAfter(element);
			}
		}
	});
  </script>
</html>
